Add support for relative-protocol urls in mw.loader.load
authorKrinkle <krinkle@users.mediawiki.org>
Mon, 25 Jul 2011 23:04:30 +0000 (23:04 +0000)
committerKrinkle <krinkle@users.mediawiki.org>
Mon, 25 Jul 2011 23:04:30 +0000 (23:04 +0000)
resources/mediawiki/mediawiki.js

index e9947bc..00b8218 100644 (file)
@@ -990,7 +990,7 @@ window.mw = window.mediaWiki = new ( function( $ ) {
                        // Allow calling with an external script or single dependency as a string
                        if ( typeof modules === 'string' ) {
                                // Support adding arbitrary external scripts
-                               if ( modules.substr( 0, 7 ) === 'http://' || modules.substr( 0, 8 ) === 'https://' ) {
+                               if ( modules.substr( 0, 7 ) === 'http://' || modules.substr( 0, 8 ) === 'https://' || modules.substr( 0, 2 ) === '//' ) {
                                        if ( type === 'text/css' ) {
                                                $( 'head' ).append( $( '<link/>', {
                                                        rel: 'stylesheet',